<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>顶部导航栏</title>
</head>
<body>
<div class="index-nav">
    <div class="nav-body">
        <div class="nav-left">
            <p><a href="" class="jumpIndex">首页</a></p>
        </div>
        <div class="nav-right">
            <p>欢迎您，<span class="userName"></span> :)</p>
        </div>
    </div>
    <div class="success" id="success">
        <p>登录成功:)</p>
    </div>
</div>
<div class="tip-wrap">
    <div class="tip">太失败力:(</div>
</div>
</body>
<script src="../../js/jQuery.js"></script>
<script>
    let success = sessionStorage.getItem("success");
    let jurisdiction = sessionStorage.getItem("jurisdiction");

   switch (jurisdiction){
       case "0":
           $('.jumpIndex').attr("href","../userIndex/userIndex.html");
           break;
       case "1":
           $('.jumpIndex').attr("href","../adminIndex/adminIndex.html");
           break;
   }




    if(success){
        setTimeout(()=>{
            $(".success").css("top","32px");
        },100)
        setTimeout(()=>{
            $(".success").css("top","-52px");
        },1000);
        sessionStorage.removeItem("success");
    }

    let UserName = sessionStorage.getItem('UserName');
    $('.userName').html(UserName);
</script>
</html>